package com.example.consumer.direct;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class FanoutReceiver {
    public static final String fanout_A = "fanout.A";
    public static final String fanout_B = "fanout.B";
    public static final String fanout_C = "fanout.C";

    @RabbitListener(queues = fanout_A)
    @RabbitHandler
    public void fanout_A(Map testMessage) {
        log.info("fanout_A  {}" , testMessage);
    }

    @RabbitListener(queues = fanout_B)
    @RabbitHandler
    public void fanout_B(Map testMessage) {
        log.info("fanout_B  {}" , testMessage);
    }

    @RabbitListener(queues = fanout_C)
    @RabbitHandler
    public void fanout_C(Map testMessage) {
        log.info("fanout_C  {}" , testMessage);
    }

}
